/***********************************************************************
 * POJO Class :  SysActor.java
 * Author:  Bill Vison
 * Purpose: Defines the Class SysActor
 ***********************************************************************/

package org.vsg.security.model.domain;
import java.util.HashSet;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

@Entity
@Table(name = "sys_actor")
@Inheritance(strategy=InheritanceType.JOINED)
public class SysActor implements java.io.Serializable,java.lang.Cloneable {


	@Column(name ="id")
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)			
	private int id;
	 
	
	private String code;
	 
	
	private String name;
	 
	
	private String description;
	 
	@Column(name ="CREATED_DATE")
	private java.sql.Timestamp createdDate;
	 
	@Column(name ="FLAG_DISABLE")
	private short flagDisable;
	 
	@Column(name ="FLAG_DELETED")
	private short flagDeleted;
	 
	@ManyToMany( cascade = {CascadeType.ALL})
	@JoinTable(
		name="map_actor_role",
		joinColumns = @JoinColumn( name="id_sys_actor"),
		inverseJoinColumns = @JoinColumn( name="id_sys_role")
	)	
	private java.util.Set<SysRole> assignedRoles = new HashSet<SysRole>();
	 


	
	/**
	 * @param newId
	 */	
	public void setId(int newId) {
		id = newId;
	}
	
	public int getId() {
		return id;
	}	
	
	/**
	 * @param newCode
	 */	
	public void setCode(String newCode) {
		code = newCode;
	}
	
	public String getCode() {
		return code;
	}	
	
	/**
	 * @param newName
	 */	
	public void setName(String newName) {
		name = newName;
	}
	
	public String getName() {
		return name;
	}	
	
	/**
	 * @param newDescription
	 */	
	public void setDescription(String newDescription) {
		description = newDescription;
	}
	
	public String getDescription() {
		return description;
	}	
	
	/**
	 * @param newCreatedDate
	 */	
	public void setCreatedDate(java.sql.Timestamp newCreatedDate) {
		createdDate = newCreatedDate;
	}
	
	public java.sql.Timestamp getCreatedDate() {
		return createdDate;
	}	
	
	/**
	 * @param newFlagDisable
	 */	
	public void setFlagDisable(short newFlagDisable) {
		flagDisable = newFlagDisable;
	}
	
	public short getFlagDisable() {
		return flagDisable;
	}	
	
	/**
	 * @param newFlagDeleted
	 */	
	public void setFlagDeleted(short newFlagDeleted) {
		flagDeleted = newFlagDeleted;
	}
	
	public short getFlagDeleted() {
		return flagDeleted;
	}	
	
	/**
	 * @param newAssignedRoles
	 */	
	public void setAssignedRoles(java.util.Set<SysRole> newAssignedRoles) {
		assignedRoles = newAssignedRoles;
	}
	
	public java.util.Set<SysRole> getAssignedRoles() {
		return assignedRoles;
	}	

}